home *** CD-ROM | disk | FTP | other *** search
/ Interactive Web Graphics with Shout 3D / Interactive Web Graphics With Shout 3D.iso / mac / Code / Chapter09 / twotimesensors.s3d < prev   
Text File  |  2000-08-29  |  982b  |  60 lines

  1.  
  2. DEF Box01 Transform {
  3.   children [ 
  4.     Shape {
  5.       appearance   Appearance {
  6.      material   Material {
  7.        diffuseColor   0.898 0.6039 0.8431
  8.      }
  9.       }
  10.    
  11.       geometry Box {
  12.       }
  13.     }
  14.   ] 
  15.   translation   0 0 0
  16. }
  17.  
  18.  
  19.  
  20. #Horizontal animation
  21.  
  22. DEF timer TimeSensor {
  23.   startTime 0
  24.   cycleInterval   2
  25.   loop TRUE
  26. }
  27.  
  28.  
  29. DEF Box01-POS-INTERP PositionInterpolator {
  30.   key   [ 0, 1 ]
  31.   keyValue [
  32.         #horizontal
  33.         0 0 0,
  34.         5 0 0 ]
  35. }
  36.  
  37.  
  38.  
  39. #Vertical Animation
  40.  
  41. DEF timer2 TimeSensor {
  42.   startTime -1
  43.   cycleInterval   8
  44.   loop TRUE
  45. }
  46.  
  47.  
  48. DEF Box01-POS-INTERP2 PositionInterpolator {
  49.   key   [ 0, 1 ]
  50.   keyValue [
  51.         #vertical
  52.         0 0 0,
  53.         0 4 0 ]
  54.  }
  55.  
  56. ROUTE timer.fraction_changed TO Box01-POS-INTERP.set_fraction
  57. ROUTE Box01-POS-INTERP.value_changed TO Box01.set_translation
  58.  
  59. ROUTE timer2.fraction_changed TO Box01-POS-INTERP2.set_fraction
  60. ROUTE Box01-POS-INTERP2.value_changed TO Box01.set_translation